<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <button id="btn">button</button>
</body>
    <script>
       var btn = document.getElementById('btn');
        btn.onmouseover = function(){
            var xhr = new XMLHttpRequest();
            xhr.open('get','1.php',true);
            xhr.send(null);
            xhr.onreadystatechange = function(){
                if(this.readyState == 4){
                    console.log(this.responseText);
                }
            }
        }
    </script>
</html>